//
//  FUIAlertView+defaultSetting.m
//  CoolMove
//
//  Created by CA on 15/3/29.
//  Copyright (c) 2015年 CA. All rights reserved.
//

#import "FUIAlertView+customizeAppearance.h"

@implementation FUIAlertView (customizeAppearance)

- (void)customizeAppearance
{
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:18.0f];
    self.messageLabel.textColor = [UIColor blackColor];
    self.messageLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    self.backgroundOverlay.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.3f];

    self.alertContainer.backgroundColor = [UIColor colorWithHex:0xf7f7f7 alpha:1.0];
    self.alertContainer.layer.cornerRadius = 10.0f;
    
    self.defaultButtonColor = [UIColor whiteColor];
    self.defaultButtonShadowHeight = 2.0f;
    self.defaultButtonShadowColor = [UIColor clearColor];
    self.defaultButtonFont = [UIFont fontWithName:@"HelveticaNeue" size:15.0f];
    
    NSInteger index = 0;
    for (UIButton *button in self.buttons) {
        button.layer.borderWidth = 0.5;
        button.layer.cornerRadius = 5;
        if (index == 0) {
            button.layer.borderColor = [UIColor colorWithHex:0x7c7b80 alpha:0.5].CGColor;
            [button setTitleColor:kUnSelectedColor forState:UIControlStateNormal];
        }else{
            button.layer.borderColor = kSelectedColor.CGColor;
            [button setTitleColor:kSelectedColor forState:UIControlStateNormal];
        }
        index++;
    }
}

+ (FUIAlertView *)alertWithTitle:(NSString *)title
                       message:(NSString *)message
                   cancelTitle:(NSString *)cancelTitle
                  confirmTitle:(NSString *)confirmTitle
{
    return [[FUIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:confirmTitle, nil];
}


@end
